/*
 Copyright (C) 2008  Maurizio Monticelli

 This program is free software; you can redistribute it and/or modify it under the terms of the 
 GNU General Public License as published by the Free Software Foundation; either version 2 of the 
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 
 Public License for more details.

 You should have received a copy of the GNU General Public License along with this program; if not, write 
 to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 
 */

package ch.justdoit.andriodrpncalc.model;

import java.util.ArrayList;
import java.util.List;

public class Settings {
	public enum BASE {
		DEC, BIN, OCT, HEX
	}

	public enum TYPE {
		REALS, BIGREALS, // BigDecimal
		INTEGER, RATIONALS
		// BigInteger
	}

	public enum ROUNDING {
		NONE, R45, R56, FLOOR, CIEL
	}

	private List<IOnBaseChangedListener> onBaseChangedListernerList;

	

	private boolean expressionMode = false;

	private BASE displayBase = BASE.BIN;
	private TYPE calcType = TYPE.REALS;
	private ROUNDING rounding = ROUNDING.NONE;

	private int digitsAfterPoint = 0;

	public Settings() {
		onBaseChangedListernerList = new ArrayList<IOnBaseChangedListener>();
	}
	public void registerOnBaseChangedListener(
			IOnBaseChangedListener onBaseChangedListerer) {
		onBaseChangedListernerList.add(onBaseChangedListerer);

	}
	
	public int getDigitsAfterPoint() {
		return digitsAfterPoint;
	}

	public void setDigitsAfterPoint(int digitsAfterPoint) {
		this.digitsAfterPoint = digitsAfterPoint;
	}

	public BASE getDisplayBase() {
		return displayBase;
	}

	public void setDisplayBase(BASE displayBase) {
		this.displayBase = displayBase;
	}

	public boolean isExpressionMode() {
		return expressionMode;
	}

	public void setExpressionMode(boolean expressionMode) {
		this.expressionMode = expressionMode;
	}

	public TYPE getCalcType() {
		return calcType;
	}

	public void setCalcType(TYPE calcType) {
		this.calcType = calcType;
	}

	public ROUNDING getRounding() {
		return rounding;
	}

	public void setRounding(ROUNDING rounding) {
		this.rounding = rounding;
	}

}
